layui.use('table', function () {
    var table = layui.table;
    //监听表格复选框选择
    table.on('checkbox(demo)', function (obj) {
        // console.log(obj)
    });

    //方法级渲染，负责渲染表格数据
    table.render({
        elem: '#table_aCarousel_lists'
        , url: '/aCarouselCount'
        , cols: [[
            {checkbox: true, fixed: true}
            , {field: 'id', title: '商家ID', width: 100, sort: true, fixed: true}
            , {field: 'name', title: '商铺名', width: 160}
            , {field: 'address', title: '商铺地址', width: 150}
            , {
                field: 'type',
                title: '轮播类型',
                width: 100,
                templet: "<div>{{(d.type == 1) ? '商品':(d.type == 2)?'分类':(d.type == 3)?'暂无此分类':'待审核'}}</div>"
            }
            , {
                field: 'createTime',
                field: 'createTime',
                title: '创建建时间',
                with: 160,
                templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm:ss')}}</div>"
            }
            , {
                field: 'startTime',
                title: '开始时间',
                with: 160,
                templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm:ss')}}</div>"
            }
            , {
                field: 'expiredTime',
                title: '到期时间',
                with: 160,
                templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm:ss')}}</div>"
            }
            // , {field: 'userEmail', title: '商家电话', sort: true, width: 250}
            , {
                field: 'isShow',
                title: '状态',
                width: 100,
                sort: true,
                templet: "<div>{{(d.isShow == 1) ? '展示':(d.isShow == 0)?'不展示':(d.isShow == 2)?'待展示':'待审核'}}</div>"
            }
            ,
        ]]
        , id: 'testReload'
        , page: true
        , limit: 10
        , height: 310
    });
});
